var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    name:'',
    price:'',
    id:'',
    mediaType:'',
    hongbao:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (option) {
    console.log(option)
    var id = option.sourceId;
    console.log(id)
    var name = option.name;
    console.log(name)    
    var price = option.price;
    console.log(price)
    var mediaType = option.mediaType;
    console.log(mediaType)
    var hongbao = option.hongbao;
    console.log(hongbao)
    this.setData({
      name:name,
      price:price,
      id:id,
      mediaType: mediaType,
      hongbao:hongbao
    })
  },

  lookOrder:function(){
    var id = this.data.id
    if (this.data.mediaType == 'AUDIO'){
      wx.redirectTo({
        url: '../audioAlbumDetail/audioAlbumDetail?id=' + id
      })
    }else{
      wx.redirectTo({
        url: '../videoAlbumDetail/videoAlbumDetail?id=' + id
      })
    }   
  },

  toIndex:function(){
    wx.switchTab({
      url: '../index/index'
    })
  }
})